-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppliment bundle location with positional arg #168
Conversation
Left the --support-bundle-location // -c flag in place to not dusrupt existing use, but it's no longer mandatory. sbctl subcommands `serve` and `shell` will take the first positional argument as the bundle location.
@@ -23,6 +23,7 @@ func ServeCmd() *cobra.Command { | |||
Use: "serve", | |||
Short: "Start API server", | |||
Long: `Start API server`, | |||
Args: cobra.MaximumNArgs(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this make the positional parameter mandatory, meaning that sbctl shell -s support-bundle.tar.gz
stops working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, ExactArgs
or MinimumNArgs
would make the argument mandatory. MaximumNArgs
was chosen because it allows for 0
arguments.
The serve
and shell
subcommands currently accept no arguments so the existing behavior remains the untouched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see https://cobra.dev/#positional-and-custom-arguments for the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NVM. I tested your PR and it works as intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yer, I misread Max
as Min
and jumped the gun :D
@@ -23,6 +23,7 @@ func ServeCmd() *cobra.Command { | |||
Use: "serve", | |||
Short: "Start API server", | |||
Long: `Start API server`, | |||
Args: cobra.MaximumNArgs(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yer, I misread Max
as Min
and jumped the gun :D
Left the --support-bundle-location // -c flag in place to not dusrupt existing use, but it's no longer mandatory. sbctl subcommands
serve
andshell
will take the first positional argument as the bundle location.fixes #136
fixes #59